{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<link rel="stylesheet" type="text/css" href="/Public/Css/front/front_css/system_set.css">
<style type="text/css">
	body{
		background-color: #f3f3f3;
	}
	input{
		display: inline-block;
		width: 16.3%;
		height: 2.5rem;
		margin-left: 0;
		margin-right: 0;
		border-right: 0.05rem solid #efefef;
		text-align: center;
		line-height: 2.5rem;
		font-size: 1.0rem;

	}
	.input{
		width: 90.67%;
		height: 2.5rem;
		border: 0.05rem solid #efefef;
		position: absolute;
		top:7.55rem;
		left:4.665%;
		background-color: #fff;
		border-right: 0;
	}
</style>
{/block}
{block name="content"}
<div class="title">
	
	<div class="return_icon"></div>
	<p><strong>设置支付密码</strong></p>
</div>

<!--确认支付密码-->
<div class="no_psw">
	<span class="psw_set">请确认支付密码</span>
	<div class="input" id="beginBtn"> 
		<input type="tel" placeholder="" maxlength="1" ><!--
		--><input type="tel" placeholder="" maxlength="1"><!--
		--><input type="tel" placeholder="" maxlength="1"><!--
		--><input type="tel" placeholder="" maxlength="1"><!--
		--><input type="tel" placeholder="" maxlength="1"><!--
		--><input type="tel" placeholder="" maxlength="1"> 
	</div>
</div>




{/block}
{block name="js"}
{literal}
<script type="text/javascript">

$('.return_icon').on('click',function(){
	window.location.href ='/Index/modify_pay_psw'
});
	(function (window, document) { 
var active = 0, 
inputBtn = document.querySelectorAll('input'); 
for (var i = 0 ; i < inputBtn.length; i++) { 
inputBtn[i].addEventListener('click', function () { 
inputBtn[active].focus(); 
}, false); 
inputBtn[i].addEventListener('focus', function () { 
this.addEventListener('keyup', listenKeyUp, false); 
}, false); 
inputBtn[i].addEventListener('blur', function () { 
this.removeEventListener('keyup', listenKeyUp, false); 
}, false); 
} 

//是否输入结束判断
$('input:eq(5)').bind('input propertychange',function(){
	console.log($('input:eq(5)').val());
	if($('input:eq(5)').val()!=" "){
		//此处判断两次输入是否一致

		//如果一致
		window.location.href = '/Index/set_success_pay_psw'
		
	}
});
/** 
* 监听键盘的敲击事件 
*/
function listenKeyUp() { 
var beginBtn = document.querySelector('#beginBtn'); 
if (!isNaN(this.value) && this.value.length != 0) { 
if (active <5 ) { 
active +=1 ; 
} 
inputBtn[active].focus(); 
} else if (this.value.length == 0) { 
if (active >0 ) { 
active -= 1; 
} 
inputBtn[active].focus(); 
} 
if (active >= 4) { 
var _value = inputBtn[active].value; 
if (beginBtn.className == 'begin-no' && !isNaN(_value) && _value.length != 0) { 
beginBtn.className = 'begin'; 
beginBtn.addEventListener('click', function () { 
calculate.begin(); 
}, false); 
} 

} else { 
if (beginBtn.className == 'begin') { 
beginBtn.className = 'begin-no'; 
} 
} 
} 
})(window, document);
</script>
{/literal}
{/block}